var vm_zhuanjiabiandongpici_shenhe = new Vue({
    el : "#zhuanjiabiandongpici_shenhe",
    data : {
        deptid : $("#deptid").val(),		// 单位ID

        biandongpicilist : [],// 专家变动列表custom
        biandongpiciid : '',//变动id
        biandongpici : {},//变动表

        shenhejilulist : [],

        //查询用字段
        picimingcheng : '',
        shenhezhuangtai : 0,
        //

    },
    created : function(){
        var _this = this;

        _this.bindBiandongPiciList();

    },
    methods : {

        // 根据单位ID查询下级单位
        bindBiandongPiciList : function(){
            var _this = this;

            var biandongpici_layer = layer.open({type:3});
            $.post('/system/renwu/findshenhelist', {
                deptid : _this.deptid,
                picimingcheng : _this.picimingcheng,
                shenhezhuangtai : _this.shenhezhuangtai,
                rdm : Math.random()
            },function(ppData) {
                layer.close(biandongpici_layer);

                if (ppData != null) {
                    if (ppData.result==1){
                        var data = ppData.resultContent;
                        _this.biandongpicilist = data;
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },

        toDetailList : function(ppBiandongpici){
            $.modal.openTab(ppBiandongpici.shenqingdanwei+"专家变动详情",'/system/zhuanjiabiandongdetail/customzhuanjiabiandongdetail_shenhe?piciid='+ppBiandongpici.id+'&renwuid='+ppBiandongpici.renwuid,false);
        },

        showShenhejiluModel:function(ppShiwuId){
            var _this = this;

            $("#shenhejiluModalLabel").html("审核记录");
            $("#shenhejiluModal").modal();

            _this.bindShenhejilu(ppShiwuId);
        },

        bindShenhejilu:function(ppShiwuId){
            var _this = this;

            var biandong_layer = layer.open({type:3});
            $.post('/system/renwu/findshenhejilu', {
                shiwuid : ppShiwuId,
                rdm : Math.random()
            },function(ppData) {
                layer.close(biandong_layer);

                if (ppData != null) {
                    var data = ppData;
                    _this.shenhejilulist = data.resultContent;
                }
            },"json");
        },

    },
})
